package com.example.mybatisplus.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.mybatisplus.pojo.Staff;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface StaffDao extends BaseMapper<Staff> {

    @Select("SELECT staff.*, dept.name deptName " +
            " FROM staff, dept " +
            " WHERE staff.dept = dept.id ")
    List<Staff> getListAll();
}
